In a processing device that handles data in a virtual space, in order for a data processor that processes data to read data from a storage unit, the data processor has to access the data at a physical address at which the data is stored in the storage unit. However, since the data processing unit manages data using virtual addresses, it is necessary to convert a virtual address to a physical address. To control costs, a conversion unit that performs this conversion typically only stores, in a buffer, information on part of the pages in a page table that indicates correspondence between virtual page numbers and physical page numbers. For each page, a virtual page number (information indicating a page in virtual space) is represented by the most significant bits of a virtual address, and a physical page number (information indicating a page in physical space) is represented by the most significant bits of a physical address. A virtual address is composed of a virtual page number and an offset within the page. A physical address is composed of a physical page number and an offset within the page. The offset within the page is the same for the virtual address and the physical address. Note that virtual addresses and physical addresses are outlined below with reference to FIG. 2.
The conversion unit converts a virtual address into a physical address using (i) a physical page number that is within the buffer and that corresponds to the virtual page number of the virtual address, and (ii) the offset within the page of the virtual address. Accordingly, for a page whose virtual page number exists in the buffer, the conversion unit can convert the virtual address of the page into the physical address using information in the buffer. However, for a page whose virtual page number does not exist in the buffer, the conversion unit cannot convert the virtual address of the page into the physical address using information in the buffer.
When the conversion unit has to convert the virtual address of a page whose virtual page number is not stored in the buffer into the physical address, the conversion unit reads a physical page number corresponding to the virtual page number of the required page from a storage unit, which stores the entire page table. Based on the read information, the conversion unit updates the buffer and converts the virtual address into the physical address.
Accessing the entire page table takes time, which causes a problem in a system that requires real-time processing. Accordingly, it is desirable for the conversion unit to rewrite information in page information that is no longer necessary in the buffer with page information that will be necessary.
One way of specifying which page information is not necessary is to provide a memory that stores a number of times each page is accessed and specifies, as unnecessary pages, pages with the lowest access frequency based on the number of accesses stored in the memory. Patent Literature 1, for example, recites such conventional technology.